package create_thread;

/**
 * Created with IDEA
 * author:ju bai
 * Date:2021/4/25
 * Time:19:58
 * 创建线程方法 2-2 -- 实现Runnable接口
 **/
public class Thread4 {
    /**
     * 常用！
     *
     * @param args
     */
    public static void main(String[] args) {
        //匿名内部类的方式实现线程
        Thread thread = new Thread(new Runnable() {
            @Override
            public void run() {
                System.out.println("线程名称" + Thread.currentThread().getName());
            }
        });
        thread.start();
    }
}
